assume cs:code
code segment
    start: int 16h
           call set_color

           mov ax, 4c00h
           int 21h

  set_color: cmp al, 'r'
             je red
             cmp al, 'g'
             je green
             cmp al, 'b'
             je blue
             ret
        red:push ax
            push es
            push si
            mov ax, 0b800h
            mov es, ax
            mov cx, 2000
            mov si, 1
            mov al, 3
       reds:mov es:[si], al
            add si, 2
            loop reds
            pop si
            pop es
            pop ax
           ret
    
    green: push ax
           push es
           push si
           mov ax, 0b800h
           mov es, ax
           mov cx, 2000
           mov si, 1
           mov al, 4
    greens:mov es:[si], al
           add si, 2
           loop greens
           pop si
           pop es
           pop ax
           ret

    blue:push ax
         push es
         push si
         mov ax, 0b800h
         mov es, ax
         mov cx, 2000
         mov si, 1
         mov al, 5
    blues:mov es:[si], al
          add si, 2
          loop blues
          pop si
          pop es
          pop ax
          ret

           

code ends
end start
